/* Copyright (C) 2008 Sahid Ferdjaoui <sahid@funraill.org>
 *
 *   This file is part of Postmemd.
 *
 * Postmemd is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */


#ifndef PM_TABLE_H
#define PM_TABLE_H


#include "uthash.h"

#include <sys/types.h>


typedef struct table {
	char  key[41];
	pid_t pid;

	UT_hash_handle hh;
} table_t ;


/**
 *
 *
 *
 */
int pm_table_init (table_t ** table);


/**
 *
 *
 *
 */
pid_t pm_table_get_pid (char key[]);

/**
 *
 *
 *
 */
void pm_table_del_pid (char key[]);

/**
 *
 *
 *
 */
void pm_table_add_pid (pid_t pid_slave, char key[]);


#endif
